package com.ag.admin.action;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.ag.admin.service.ICurrentEventService;
import com.ag.bean.TbCurrentEvent;
import com.ag.common.AjaxNotify;
import com.ag.common.BaseAction;

@Scope("prototype")
@Controller("LZMCurrentEventAction")
public class CurrentEventAction extends BaseAction {
	private static final long serialVersionUID = -8245405073665312104L;
	@Resource(name = "LZMCurrentEventServiceImpl")
	private ICurrentEventService currentEventService;

	private List<TbCurrentEvent> currentEvents;

	public List<TbCurrentEvent> getCurrentEvents() {
		return currentEvents;
	}

	private String ajaxRst;

	public String getAjaxRst() {
		return ajaxRst;
	}

	/**
	 * 查找当前所有事件
	 * 
	 * @return
	 */

	public String findCurrentEvent() {
		try {
			currentEvents = currentEventService.findCurrentEvent();
			ajaxRst = AjaxNotify.SUCCESS;
			return "find_current_event";
		} catch (Exception e) {
			e.printStackTrace();
			ajaxRst = AjaxNotify.EXCEPTION;
			return "operate";
		}
	}

}
